//搜索栏下面
$.ajax({
    type: 'get',
    url: '../../json/search.json',
    async: true,
    success: function (data) {
        var searchArr = data.search;
        for (var i = 0; i < searchArr.length; i++) {
            var node = $(`<a href="" class="curr">${searchArr[i].name}</a>`);
            node.appendTo(".search #hotWord");

        }
    }
})
//搜索栏下
$.ajax({
    type: 'get',
    url: '../../json/allsort1.json',
    async: 'true',
    success: function (data) {
        var topArr =data.topNav;
        for(var i = 0;i < topArr.length;i ++){
            var node = $(`<li><a href="">
                ${topArr[i].title}
            </a></li>`);
            node.appendTo(".nav #licontent");
        }
    }

})
//左边商品列表
$.ajax({
    type: 'get',
    url: '../../json/allsort1.json',
    async: true,
    success: function (data) {
        var sideArr = data.sideNav;
        for (var i = 0; i < sideArr.length; i++) {
            var node = $(`<li class = "licontent">
                <a href = "/index.html" class = "title">
                    ${sideArr[i].title}
                </a>
                </li>`);
            node.appendTo(".nav #ul_level12");
        }
        
    }
})
//中部
$.ajax({
    type: 'get',
    url: '../../json/list.json',
    async: true,
    success: function (data) {
        var middleArr = data.middle;
        for (var i = 0; i < middleArr.length; i++) {
            var node = $(`<li>
            <a href="${middleArr[i].href}">
                <img src="${middleArr[i].img}" alt="">
                <b>${middleArr[i].b}</b>
                <i>${middleArr[i].i}</i>
                <p>
                ${middleArr[i].p}
                </p>

            </a>
        </li>`);
            node.appendTo(".productList");

        }
    }
})
//右部
$.ajax({
    type: 'get',
    url: '../../json/list.json',
    async: true,
    success: function (data) {
        var rightArr = data.middleRight;
        for (var i = 0; i < rightArr.length; i++) {
            var node = $(`<li>
            <a href="">
                <img src="${rightArr[i].img}">
                <b>${rightArr[i].b}</b>
                <i>${rightArr[i].i}</i>
            </a>
        </li>`);
            node.appendTo(".searchList .fr ul");

        }
    }
})

